3.4.31 \(\int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx\) [331]

Optimal. Leaf size=116 \[ -\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {i \, _2F_1\left (1,m;1+m;\frac {1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^m}{2 d m}-\frac {i \, _2F_1(1,m;1+m;1+i \tan (c+d x)) (a+i a \tan (c+d x))^m}{d} \]

[Out]

-cot(d*x+c)*(a+I*a*tan(d*x+c))^m/d+1/2*I*hypergeom([1, m],[1+m],1/2+1/2*I*tan(d*x+c))*(a+I*a*tan(d*x+c))^m/d/m
-I*hypergeom([1, m],[1+m],1+I*tan(d*x+c))*(a+I*a*tan(d*x+c))^m/d

________________________________________________________________________________________

Rubi [A]
time = 0.17, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3642, 3681, 3562, 70, 3680, 67} \begin {gather*} \frac {i (a+i a \tan (c+d x))^m \, _2F_1\left (1,m;m+1;\frac {1}{2} (i \tan (c+d x)+1)\right )}{2 d m}-\frac {i (a+i a \tan (c+d x))^m \, _2F_1(1,m;m+1;i \tan (c+d x)+1)}{d}-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^m,x]

[Out]

-((Cot[c + d*x]*(a + I*a*Tan[c + d*x])^m)/d) + ((I/2)*Hypergeometric2F1[1, m, 1 + m, (1 + I*Tan[c + d*x])/2]*(
a + I*a*Tan[c + d*x])^m)/(d*m) - (I*Hypergeometric2F1[1, m, 1 + m, 1 + I*Tan[c + d*x]]*(a + I*a*Tan[c + d*x])^
m)/d

Rule 67

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))
*Hypergeometric2F1[-m, n + 1, n + 2, 1 + d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (Intege
rQ[m] || GtQ[-d/(b*c), 0])

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/(b^(
n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 3562

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[-b/d, Subst[Int[(a + x)^(n - 1)/(a - x), x]
, x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 + b^2, 0]

Rule 3642

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[d*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(f*(n + 1)*(c^2 + d^2))), x] - Dist[1/(a*(c^2 + d^2)*
(n + 1)), Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1)*Simp[b*d*m - a*c*(n + 1) + a*d*(m + n + 1)*T
an[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^
2 + d^2, 0] && LtQ[n, -1] && (IntegerQ[n] || IntegersQ[2*m, 2*n])

Rule 3680

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b*(B/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x
]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && EqQ[A*b + a*B,
 0]

Rule 3681

Int[(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)]))/((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(A*b + a*B)/(b*c + a*d), Int[(a + b*Tan[e + f*x])^m, x], x] - Dist[(B*c
 - A*d)/(b*c + a*d), Int[(a + b*Tan[e + f*x])^m*((a - b*Tan[e + f*x])/(c + d*Tan[e + f*x])), x], x] /; FreeQ[{
a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[A*b + a*B, 0]

Rubi steps

\begin {align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx &=-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {\int \cot (c+d x) (a+i a \tan (c+d x))^m (i a m-a (1-m) \tan (c+d x)) \, dx}{a}\\ &=-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {(i m) \int \cot (c+d x) (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^m \, dx}{a}-\int (a+i a \tan (c+d x))^m \, dx\\ &=-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {(i a) \text {Subst}\left (\int \frac {(a+x)^{-1+m}}{a-x} \, dx,x,i a \tan (c+d x)\right )}{d}+\frac {(i a m) \text {Subst}\left (\int \frac {(a+i a x)^{-1+m}}{x} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {i \, _2F_1\left (1,m;1+m;\frac {1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^m}{2 d m}-\frac {i \, _2F_1(1,m;1+m;1+i \tan (c+d x)) (a+i a \tan (c+d x))^m}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 18.73, size = 0, normalized size = 0.00 \begin {gather*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^m,x]

[Out]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^m, x]

________________________________________________________________________________________

Maple [F]
time = 1.74, size = 0, normalized size = 0.00 \[\int \left (\cot ^{2}\left (d x +c \right )\right ) \left (a +i a \tan \left (d x +c \right )\right )^{m}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x)

[Out]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x, algorithm="maxima")

[Out]

integrate((I*a*tan(d*x + c) + a)^m*cot(d*x + c)^2, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x, algorithm="fricas")

[Out]

integral(-(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c) + 1))^m*(e^(4*I*d*x + 4*I*c) + 2*e^(2*I*d*x + 2*I*c) +
 1)/(e^(4*I*d*x + 4*I*c) - 2*e^(2*I*d*x + 2*I*c) + 1), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{m} \cot ^{2}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**m,x)

[Out]

Integral((I*a*(tan(c + d*x) - I))**m*cot(c + d*x)**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^m*cot(d*x + c)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {cot}\left (c+d\,x\right )}^2\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^m \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^m,x)

[Out]

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^m, x)

________________________________________________________________________________________